package com.cw.base.common.dispatch.obtain;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.cw.base.common.dispatch.pojo.Task;
import com.cw.base.common.dispatch.queue.Queue;

import lombok.extern.slf4j.Slf4j;

/**
 * Created on 15/11/9.
 *
 * @author zhangcheng
 */
@Slf4j
public class ObtainTask implements TaskService {

    @Autowired
    @Qualifier("taskQueue")
    private Queue taskQueue;

    @Override
    public void receiveTask(Task task) {
        log.info("登记 {} 任务", task.getUuid());
        this.taskQueue.put(task);
    }
}
